<!DOCTYPE html>
<html>
<head>
    <title>书籍列表</title>
    <meta charset="utf-8">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div  id="allBook" class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>书籍列表--显示所有书籍</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4 column">
            <a class="btn btn-primary" href="addBook.html">新增书籍</a>
            <a class="btn btn-primary" href="allBook.html">显示全部书籍</a>
        </div>
        <div class="col-md-4 column"></div>
        <div class="col-md-4 column">
            <form class="form-inline" method="post"
                  style="float: right">
            <!--<span style="color:red;font-weight: bold" text="error"></span>-->
                <input v-model="queryBookName" type="text" name="queryBookName" class="form-control"
                       placeholder="输入查询书名" required>
                <input type="button" @click="selectBook()" value="查询" class="btn btn-primary">
            </form>
        </div>

    </div>

    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>书籍编号</th>
                    <th>书籍名字</th>
                    <th>书籍数量</th>
                    <th>书籍详情</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                    <tr v-for="book in books">
                        <td>{{book.bookID}}</td>
                        <td>{{book.bookName}}</td>
                        <td>{{book.bookCounts}}</td>
                        <td>{{book.detail}}</td>
                        <td>
                            <a href="javaScript:" @click="updatePage(book.bookID)">更改</a> |
                            <a href="javaScript:" @click="deleteBook(book.bookID)"> 删除</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
<script src="../js/allBook.js"></script>
</html>